<template>
  <el-tabs v-model="tabPaneVal" type="border-card" @tab-click="handleClick">
    <el-tab-pane label="入驻商资料" name="ShipmentEdit">
      <ShipmentEdit v-if="isShipmentEditShow" :parent-data="parentData" />
    </el-tab-pane>
    <!--<el-tab-pane label="开票信息管理" name="InvoiceMessage">
      <InvoiceMessage v-if="isInvoiceMessageShow" :parent-data="parentData" />
    </el-tab-pane>-->
<!--    <el-tab-pane label="地址管理" name="CommonRouteInfo">-->
<!--      <CommonRouteInfo v-if="isCommonRouteInfoShow" :parent-data="parentData" />-->
<!--    </el-tab-pane>-->
<!--    <el-tab-pane label="承运分组" name="VehicleTeam">-->
<!--      <VehicleTeam v-if="isVehicleTeamShow" :parent-data="parentData" />-->
<!--    </el-tab-pane>-->
<!--    <el-tab-pane label="计价体系" name="PriceSystem">-->
<!--      <PriceSystem v-if="isPriceSystemShow" :parentData="parentData" />-->
<!--    </el-tab-pane>-->
  </el-tabs>
</template>

<script>
import ShipmentEdit from "./components/shipmentEdit.vue";
import InvoiceMessage from "./components/invoiceMessage/invoiceMessageList.vue";
// import CommonRouteInfo from "./components/commonRouteInfo/commonRouteInfoList.vue";
// import VehicleTeam from "./components/vehicleTeam/vehicleTeamList.vue";
// import PriceSystem from "@/views/basicInfo/priceSystem/priceSystem.vue";
import { SelectAddress } from "@/api/orderform";
import { getListDict, getShipperList} from "@/api/shipment";
export default {
  name: "EditShipmentForm",
  components: {
    ShipmentEdit,
    InvoiceMessage,
    // CommonRouteInfo,
    // VehicleTeam,
    // PriceSystem
  },
  data() {
    return {
      parentData: {
        areaOptions: [],
        receiverUserCodeOptions: [],
        typeOptions: [],
        vehicleDictList: [],
        bankOptions: []
      },
      tabPaneVal: "ShipmentEdit",
      isShipmentEditShow: true,
      isInvoiceMessageShow: false,
      isCommonRouteInfoShow: false,
      isVehicleTeamShow: false,
      // isPriceSystemShow: false
    };
  },
  created() {
    // 省市县
    SelectAddress().then(response => {
      this.parentData.areaOptions = response.data.records;
    });
    // 收票人选项
    getShipperList({ staffTypes: "0, 4, 6" }).then(response => {
      this.parentData.receiverUserCodeOptions = response.data.records;
    });
    // 货物类型字典
    // getGoodsTypeDict({ parentCode: "goodsBigType" }).then(response => {
    //   this.parentData.goodsTypeList = response.data.records;
    // });
    // 开票方式、车型、开户银行
    getListDict({ types: "billingType, vehicleClassification, bank" }).then(response => {
      this.parentData.typeOptions = response.data.filter(
        item => item.type === "billingType"
      )[0]["dictList"];
      this.parentData.vehicleDictList = response.data.filter(
        item => item.type === "vehicleClassification"
      )[0]["dictList"];
      this.parentData.bankOptions = response.data.filter(
        item => item.type === "bank"
      )[0]["dictList"];
    });
  },
  methods: {
    handleClick(tab, event) {
      this[`is${tab.name}Show`] = true;
    }
  }
};
</script>
